<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../react18/react.development.js"></script>
    <script src="../react18/react-dom.development.js"></script>
    <script src="../react18/babel.min.js"></script>
  </head>
  <body>
    <div id="app"></div>
    <script type="text/babel">
      /* 
        不定义组件,直接使用封装函数的方式包裹虚拟DOM会有很多的缺点
          * 识别性不高,一般组件的调用是使用大写的标签调用<Title/>
          * 不具备组件拥有的功能(生命周期,状态等等功能)
          * 开发者工具也不会识别
      
      
      */
      function header() {
        const titleTime = "2023-3-22";
        return (
          <div>
            <h1>头部一级标题</h1>
            <h2>头部二级标题 {titleTime}</h2>
          </div>
        );
      }
      function app() {
        return (
          <div>
            {header()}
            <div>content</div>
          </div>
        );
      }

      ReactDOM.createRoot(document.getElementById("app")).render(app());
    </script>
  </body>
</html>
